<?php

//echo ''.$_POST['report'].'';

//$report=explode("\n",$_POST['report']);
//$alltitle=array('Progress','Problem','Plan');
//$ip=0;
//$TeamList[$ip] = array('type'=>$alltitle[$ip]);
//for($io=0;$io<count($report);$io++){
//	if((isset($report[$io-1]) && $report[$io-1]=='')){
//		$ip++;
//		$TeamList[$ip] = array('type'=>$alltitle[$ip]);
//	}
//	if(isset($report[$io-1]) && $report[$io-1]==''){
//		if($report[$io]=='')
//			$TeamList[$ip]['matches'][] = array('title'=>'暂无');
//	}
//	
//	if($report[$io]!='')
//		$TeamList[$ip]['matches'][] = array('title'=>$report[$io]);
//}


$report=explode("\n",$_POST['report']);
$alltitle=array('Progress','Problem','Plan');
$ip=0;
$TeamList[$ip] = array('type'=>$alltitle[$ip]);
for($io=0;$io<count($report);$io++){
	if((isset($report[$io-1]) && $report[$io-1]=='')){
		$ip++;
		$TeamList[$ip] = array('type'=>$alltitle[$ip]);
	}
	if(isset($report[$io-1]) && $report[$io-1]==''){
		if($report[$io]=='')
			$TeamList[$ip]['matches'][] = array('title'=>'暂无');
	}
	
	if($report[$io]!=''){
		
		if(substr($report[$io],0,1)!='-')
			$TeamList[$ip]['matches'][] = array('title'=>$report[$io]);
		else
			$TeamList[$ip]['matches'][][] = array('title'=>$report[$io]);
		
	}
}

//$TeamList[0] = array('type'=>'Progress');
//$TeamList[0]['matches'][] = array('title'=>'学习py和django，看共享资料中的视频；');
//$TeamList[0]['matches'][] = array('title'=>'检查会议PPT稿件和教程，整理演示流程；');
//$TeamList[1] = array('type'=>'Problem');
//$TeamList[1]['matches'][] = array('title'=>'补充adtree的演示资料；');
//$TeamList[1]['matches'][] = array('title'=>'制定自己的项目开发原则，目的减少最后BUG的数量；');
//$TeamList[2] = array('type'=>'Plan');
//$TeamList[2]['matches'][] = array('title'=>'深入研究Google Voice短信接口； ');
//$TeamList[2]['matches'][] = array('title'=>'掌握关于Linux服务器SecureCRT和Vim的命令；');
//$TeamList[2]['matches'][] = array('title'=>'sina素材内容生成器；');

//print_r($TeamList);
//print_r($report);

print_r($TeamList);
?>